const mysql = require('mysql');

function database(sql,arr,cd) {
    const connection = mysql.createConnection({
        host: 'localhost',
        user: 'root',
        password: '123456',
        database: 'crawler'
    });
    connection.connect();
    connection.query(sql,arr, function (error, results, fields) {
        cd(error,results);
    })
    connection.end();
}

module.exports = database;